package com.ejuornal.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ejuornal.bean.Page;
import com.ejuornal.bean.vo.User_EditorChief;
import com.ejuornal.dao.EditorChiefVoDao;
import com.ejuornal.service.EditorChiefVoService;
@Component("editorChiefVoService")
public class EditorChiefVoServiceImpl implements EditorChiefVoService{
	private EditorChiefVoDao editorChiefVoDao;
	
	public Page<User_EditorChief> findChiefVoByStatus(int current_record,String url, String value){
		String  count =" SELECT DISTINCT COUNT(*) FROM t_editor_chief ec ,t_user u WHERE ec.userId = u.userId AND u.roleId !=1 AND ec.`status`= ? ";
		String sql = " SELECT DISTINCT ec.*,u.userName  FROM t_editor_chief ec ,t_user u WHERE ec.userId = u.userId AND u.roleId !=1 AND ec.`status`= ?  limit " + current_record + ", 10 ";
		return editorChiefVoDao.find(current_record, url, count, sql, new Object[]{value});
	}
	
	public EditorChiefVoDao getEidChiefVoDao() {
		return editorChiefVoDao;
	}
	@Resource(name="editorChiefVoDao")
	public void setEidChiefVoDao(EditorChiefVoDao editorChiefVoDao) {
		this.editorChiefVoDao = editorChiefVoDao;
	}
	

}
